package com.polysichong.netschool.action.admin;

import java.util.List;

import com.polysichong.framework.action.BaseAction;
import com.polysichong.netschool.entity.admin.User;
import com.polysichong.netschool.service.admin.UserService;

public class UserListAction extends BaseAction {
	
	private static final long serialVersionUID = 3129180317813363754L;
	
	private UserService userService;
	
	private List<User> list = null;
	private Long id = null;

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	public List<User> getList() {
		return list;
	}

	public void setList(List<User> list) {
		this.list = list;
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String doInit() throws Exception{
		list = userService.findAllUsers();
		return SUCCESS;
	}
	
	public String doDelete()throws Exception{
		userService.delete(id);
		return doInit();
	}
}
